from random import random

n=int(random()*100)
print(n)
money=5000
while money>0:
    guess=int(input("请输入你的答案"))
    if guess>n:
        print("猜大了")
        money -= 500
    elif guess<n:
        print("猜小了")
        money -= 500
    else :
        print("恭喜猜中，本轮幸运数字:" ,n)
        money+=3000
    print("您的余额为:",money)
else:
    print("不好意思，余额不足")